<%inherit file="base.html"/>
<%def name="title()">Assets positions breakdown</%def>
<%def name="header()">
    <script>
        var prm=0;
        function myRowStyler(itemID, db, tr, index) {
            var id = tr.getAttribute('ex:itemid');
            var a = tr.rows[index+1].cells[4].getAttribute('MKTVAL')
            a=parseFloat(a);
            if (index == 0) {
                prm =a;
            } else {
                prm=prm+a;
            }
            totalmktval.innerHTML=prm.toFixed(2)+'';
        }
    </script>
</%def>
Total market value <span id="totalmktval"></span>
<div ex:role="exhibit-collection" ex:itemTypes="position"></div>
    <table>
        <tr>
            <td>
<div ex:role="view"
     ex:viewClass="Tabular"
     ex:showSummary="false"
     ex:columns=".ASSETCLASS, .UNIQUEID, .UNIQUEID.SECNAME, .UNIQUEID.TICKER, .MKTVAL, .DTASOF, .ACCTID"
     ex:columnLabels="asset class, ID, name, ticker, value, date, account"
     ex:formats="date { mode: short }  number { decimal-digits: 2 }"
     ex:sortColumn="4"
     ex:rowStyler="myRowStyler"
     ex:sortAscending="false"
     ex:showToolbox="true">
    <table style="display: none;">
        <tr>
            <td><span ex:content=".ASSETCLASS"></span></td>
            <td><span ex:content=".UNIQUEID"></span></td>
            <td><a ex:href-content="concat('asset?UNIQUEID=',.UNIQUEID)"><span ex:content="min(.UNIQUEID.SECNAME)"></span></a></td>
            <td><a ex:href-content="concat('http://finance.yahoo.com/q?s=',.UNIQUEID.TICKER)" target="_blank">
                <span ex:content=".UNIQUEID.TICKER"></span></a></td>
            <td style="text-align:right" ex:MKTVAL-content=".MKTVAL"><span ex:content=".MKTVAL"></span></td>
            <td><span ex:content=".DTASOF"></span></td>
            <td><span ex:content=".ACCTID"></span></td>
        </tr>
    </table>
</div>
             </td>
            <td width="25%">
<div ex:role="facet" ex:expression=".ACCTID" ex:facetLabel="Account"></div>
<div ex:role="facet" ex:expression=".DTASOF" ex:facetLabel="Date" ex:sortDirection="reverse"></div>
<div ex:role="facet" ex:expression=".ASSETCLASS" ex:facetLabel="Asset Class"></div>
<div ex:role="facet" ex:expression=".UNIQUEID.SECTYPE" ex:facetLabel="Security Type"></div>
<b>Asset name:</b>
<div ex:role="facet" ex:facetClass="TextSearch"></div>
<div ex:role="facet" ex:expression=".UNIQUEID.SECNAME" ex:facetLabel="or"></div>
           </td>
        </tr>
    </table>

